home *** CD-ROM | disk | FTP | other *** search
- function init()
- {
- hxColorDefault = Tardis.Colors.getHex("nav");
- Tardis.makeButtonShield();
- makeNav();
- delete makeNav;
- delete init;
- Tardis.ChildLock.EB.addListener(this);
- onComplete();
- }
- function setActive(str)
- {
- clearActive();
- objActive = this["mc_" + str];
- highlightClip(objActive);
- }
- function clearActive()
- {
- resetClip(objActive);
- objActive = null;
- }
- function enable()
- {
- var obj;
- for(var o in this)
- {
- obj = this[o];
- if(obj.enabled != undefined)
- {
- obj.enabled = true;
- }
- }
- }
- function disable()
- {
- var obj;
- for(var o in this)
- {
- obj = this[o];
- if(obj.enabled != undefined)
- {
- obj.enabled = false;
- }
- }
- }
- function show()
- {
- _visible = true;
- }
- function hide()
- {
- _visible = false;
- }
- function childLockSet(val)
- {
- var mc;
- for(var o in this)
- {
- mc = this[o];
- if(typeof mc == "movieclip" && mc._name.indexOf("kids") == -1 && mc._name.indexOf("_ha") == -1)
- {
- mc._visible = !val;
- }
- }
- }
- function splashOff()
- {
- var mc = this["mc_" + strSplashActiveButton];
- if(objActive != mc)
- {
- resetClip(mc);
- }
- strSplashActiveButton = "";
- }
- function splashOn(str)
- {
- strSplashActiveButton = str;
- highlightClip(this["mc_" + str]);
- }
- function __onOver()
- {
- lingo("cursor 280");
- if(objActive == this)
- {
- return undefined;
- }
- if(Tardis.ActiveSection == null)
- {
- splashOff();
- splashOn(this.id);
- }
- else
- {
- highlightClip(this);
- }
- onOver(this.id);
- updateAfterEvent();
- }
- function __onOut()
- {
- lingo("cursor -1");
- if(objActive == this)
- {
- return undefined;
- }
- if(Tardis.ActiveSection != null)
- {
- resetClip(this);
- }
- onOut();
- updateAfterEvent();
- }
- function __onUp()
- {
- if(this.disabled == "true")
- {
- return undefined;
- }
- trace("click a nav item - shut all overlays");
- Tardis.OverlayController.closeAll();
- if(objActive != this)
- {
- resetClip(objActive);
- objActive = this;
- }
- trace("ID:" + this.id);
- onUp(this.id);
- }
- function makeNav()
- {
- var len = Tardis.Sections.length;
- var clp;
- var nd;
- var strID;
- var arrClips = [];
- var arrMasks = [];
- var arrHAclips = [];
- var hitareaX = 15;
- var totalButtonTextWidth;
- var n = 0;
- while(n < len)
- {
- var w = arrHitareaWidths[n];
- nd = Tardis.Sections.item(n);
- strID = nd.id;
- clp = this.createEmptyMovieClip("mc_" + strID,Tardis.depth++);
- clp.createTextField("txt",Tardis.depth++,0,0,100,50);
- for(var o in nd)
- {
- clp[o] = nd[o];
- }
- clp.hxOverColor = Tardis.Colors.getHex(strID);
- with(clp.txt)
- {
- embedFonts = true;
- html = true;
- htmlText = "<font face=\"TardisFGExtraBoldCondensed\" size=\"24\">" + nd.label + "</font>";
- autoSize = "left";
- textColor = hxColorDefault;
- }
- totalButtonTextWidth += clp.txt._width;
- clp.onRollOver = __onOver;
- clp.onReleaseOutside = __onOut;
- clp.onRollOut = __onOut;
- if(!(Tardis.PLAY_MODE == "browser" && nd.sandbox == "true"))
- {
- clp.onRelease = __onUp;
- }
- arrClips.push(clp);
- n++;
- }
- Tardis.spaceEvenly(arrClips,15,785,null,true);
- var l = arrClips.length;
- var posHorizontal = 15;
- var buttonPadding = (770 - totalButtonTextWidth) / (l * 2 - 2);
- var i = 0;
- while(i < l)
- {
- var clp = arrClips[i];
- var maskX;
- var maskW;
- if(i == 0)
- {
- maskX = clp._x;
- maskW = maskX + clp._width + buttonPadding;
- }
- else if(i == l - 1)
- {
- maskX = clp._x - buttonPadding;
- maskW = 770 + posHorizontal;
- }
- else
- {
- maskX = clp._x - buttonPadding;
- maskW = maskX + clp._width + buttonPadding * 2;
- }
- h = clp.txt.textHeight;
- clpHA = this.createEmptyMovieClip("mc_" + strID + "_ha",Tardis.depth++);
- clpHA.moveTo(maskX,0);
- clpHA.beginFill(16711680);
- clpHA.lineTo(maskW,0);
- clpHA.lineTo(maskW,h);
- clpHA.lineTo(maskX,h);
- clpHA.lineTo(maskX,0);
- clpHA.endFill();
- clp.hitArea = clpHA;
- clp.hitArea._visible = false;
- i++;
- }
- }
- function highlightClip(mc)
- {
- mc.txt.textColor = mc.hxOverColor;
- if(faded)
- {
- mc._alpha = 100;
- }
- }
- function resetClip(mc)
- {
- mc.txt.textColor = hxColorDefault;
- if(faded)
- {
- mc._alpha = FADE_LIMIT;
- }
- }
- function fadeOthers(strIDExcept, strUpDown)
- {
- var len = Tardis.Sections.length;
- var strF = strUpDown != "down" ? "fadeUpEnterFrame" : "fadeDownEnterFrame";
- var nd;
- var strID;
- var n = 0;
- while(n < len)
- {
- nd = Tardis.Sections.item(n);
- strID = nd.id;
- if(strID != strIDExcept)
- {
- mc = this["mc_" + strID];
- mc.onEnterFrame = this[strF];
- }
- n++;
- }
- this.faded = strUpDown == "down";
- }
- function fadeDownEnterFrame()
- {
- with(this)
- {
- if(_alpha > FADE_LIMIT)
- {
- _alpha -= 10;
- }
- else
- {
- onEnterFrame = null;
- }
- }
- }
- function fadeUpEnterFrame()
- {
- with(this)
- {
- if(_alpha < 100)
- {
- _alpha += 10;
- }
- else
- {
- onEnterFrame = null;
- }
- }
- }
- FADE_LIMIT = 50;
-